<template>
	<view class="type_area">

		<view class="box_top2">
			<view class="" style="width: 90%;margin: 0 auto;">
				<view class="" style="font-size: 30rpx;font-weight: 700;color: #333;padding-top: 30rpx;">团队成员 ({{ALL}}人)
				</view>

				<view class="" v-for="(item) in chengyuanLsit" :key="item.id">
					<view class=""
						style="width: 630rpx;height: 0rpx;border: 2rpx solid #F7F8FA;margin: 0 auto;margin-top: 30rpx;">
					</view>
					<view class="dispJC dispAI MT_30">
						<view class="dispAI" style="display: flex;">
							<image :src="item.avatar"
								style="width: 100rpx;height: 100rpx;border-radius: 50%;margin-right: 20rpx;" mode="">
							</image>
							<view class="">
								<view class="" style="font-size: 28rpx;color: #333;">{{item.name}}</view>
								<view class="" style="font-size: 24rpx;color: #999;">{{item.created_at}}加入</view>
							</view>
						</view>

					</view>
				</view>
			</view>
		</view>
		<view class="" style="height: 100rpx;"></view>
	</view>
</template>

<script>
	import {
		team
	} from "@/api/api.js"
	export default {
		data() {
			return {
				chengyuanLsit: [],
				page: 1,
				ALL: ""
			}
		},
		onLoad() {
			this.getYijichengyuan()
		},
		methods: {
			// 获取成员列表
			async getYijichengyuan() {
				let data = {
					page: this.page,
					page_size: 10
				}
				let res = await team(data)
				console.log(res, '获取成员列表');
				this.ALL = res.data.zt_num
				this.chengyuanLsit = [...this.chengyuanLsit, ...res.data.data.data]
				if (res.data.data.data[0]) {
					this.page++
				} else if (this.page > 1) {
					setTimeout(
						function() {
							uni.$u.toast("没有更多数据了~");
						}, 500)
				}

			},

		},
		// 触底的事件
		onReachBottom(e) {
			let that = this
			setTimeout(
				function() {
					that.getYijichengyuan()
				}, 300)
		},
	}
</script>

<style scoped lang="scss">
	.box_top1 {
		width: 330rpx;
		height: 154rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
	}

	.box_top2 {
		width: 690rpx;
		// height: 1062rpx;
		padding-bottom: 50rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}
</style>